<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
	.errorLabel {
		border-color: red;
		color: red;
	}
	.required {
		font-weight: bold;
	}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title><s:text name="welcome.title" /></title>
</head>
<body>
	<p>
		<s:text name="productsearch.title" />
	</p>
	<p>
		<s:form action="ProductSearch_forward">
			<s:select name="searchIn" key="productsearch.searchin" list="#{'name':'Name', 'description':'Beschreibung' }" />
			<s:select name="categoryId" key="productsearch.category" list="%{categoryList}" listKey="categoryId"
				listValue="name" headerKey="-1" headerValue="" />
			<s:textfield name="searchFor" key="productsearch.searchfor" size="20"
				required="true" /><br />
			<s:submit key="button.search" />
			<s:hidden name="searchDataSend" value="true" />
		</s:form>
	</p>
	
	<s:a action="ProductSearch_backwards"><s:text name="button.back" /></s:a>
	<font color="red">
		<s:actionerror label="label" />
	</font>
	<s:actionmessage label="label" />
	
	<p>
		<table width="100%" border="0" cellpadding="5">
			<s:iterator value="resultList">
				<tr>
					<th colspan="2" bgcolor="#888888">
						<b><s:property value="name"/></b>
					</th>
				</tr>
				<s:iterator value="products" status="rowstatus">
					<s:if test="#rowstatus.odd == true">
							<tr bgcolor="#CCCCCC">
						<s:else>
							<tr bgcolor="EEEEEE">
						</s:else>
					</s:if>
						<td width="3%" bgcolor="FFFFFF">&nbsp;</td>
						<td>
							<s:url var="url" action="ProductDetail">
								<s:param name="productId">
									<s:property value="productId"/>
								</s:param>
							</s:url> 
							<s:a href="%{url}">
								<s:property value="name" />
							</s:a>
						</td>
					</tr>
				</s:iterator>
			</s:iterator>
		</table>
	</p>
</body>
</html>